package co.edu.usbcali.hibernate.persistencia;

import java.util.List;
import java.util.Set;

import co.edu.usbcali.hibernate.modelo.Mascotas;

/**
 * Interface for MascotasDAO.
 * 
 * @author MyEclipse Persistence Tools
 */

public interface IMascotasDAO {
	/**
	 * Perform an initial save of a previously unsaved Mascotas entity. All
	 * subsequent persist actions of this entity should use the #update()
	 * method. This operation must be performed within the a database
	 * transaction context for the entity's data to be permanently saved to the
	 * persistence store, i.e., database. This method uses the
	 * {@link javax.persistence.EntityManager#persist(Object)
	 * EntityManager#persist} operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * IMascotasDAO.save(entity);
	 * EntityManagerHelper.commit();
	 * </pre>
	 * 
	 * @param entity
	 *            Mascotas entity to persist
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void save(Mascotas entity);

	/**
	 * Delete a persistent Mascotas entity. This operation must be performed
	 * within the a database transaction context for the entity's data to be
	 * permanently deleted from the persistence store, i.e., database. This
	 * method uses the {@link javax.persistence.EntityManager#remove(Object)
	 * EntityManager#delete} operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * IMascotasDAO.delete(entity);
	 * EntityManagerHelper.commit();
	 * entity = null;
	 * </pre>
	 * 
	 * @param entity
	 *            Mascotas entity to delete
	 * @throws RuntimeException
	 *             when the operation fails
	 */
	public void delete(Mascotas entity);

	/**
	 * Persist a previously saved Mascotas entity and return it or a copy of it
	 * to the sender. A copy of the Mascotas entity parameter is returned when
	 * the JPA persistence mechanism has not previously been tracking the
	 * updated entity. This operation must be performed within the a database
	 * transaction context for the entity's data to be permanently saved to the
	 * persistence store, i.e., database. This method uses the
	 * {@link javax.persistence.EntityManager#merge(Object) EntityManager#merge}
	 * operation.
	 * 
	 * <pre>
	 * EntityManagerHelper.beginTransaction();
	 * entity = IMascotasDAO.update(entity);
	 * EntityManagerHelper.commit();
	 * </pre>
	 * 
	 * @param entity
	 *            Mascotas entity to update
	 * @return Mascotas the persisted Mascotas entity instance, may not be the
	 *         same
	 * @throws RuntimeException
	 *             if the operation fails
	 */
	public Mascotas update(Mascotas entity);

	public Mascotas findById(Long id);

	/**
	 * Find all Mascotas entities with a specific property value.
	 * 
	 * @param propertyName
	 *            the name of the Mascotas property to query
	 * @param value
	 *            the property value to match
	 * @return List<Mascotas> found by query
	 */
	public List<Mascotas> findByProperty(String propertyName, Object value);

	public List<Mascotas> findByMasNombre(Object masNombre);

	public List<Mascotas> findByMasEdad(Object masEdad);

	/**
	 * Find all Mascotas entities.
	 * 
	 * @return List<Mascotas> all Mascotas entities
	 */
	public List<Mascotas> findAll();
}